Don't set the have_focused field of the window's toplevel to TRUE by
default and don't set the FOCUSED state in gdk_window_map. This a means
toplevel window's state is what the WM expects, and the FOCUSED state
will be set anyway when we map the window and receive a _NET_WM_STATE
message.
if (gdk_window_has_impl (window))
{
if (!was_mapped)
- gdk_synthesize_window_state (window,
- GDK_WINDOW_STATE_WITHDRAWN,
- GDK_WINDOW_STATE_FOCUSED);
+ gdk_synthesize_window_state (window,
+ GDK_WINDOW_STATE_WITHDRAWN,
+ 0);
}
else
{
if (!impl->toplevel)
{
impl->toplevel = g_new0 (GdkToplevelX11, 1);
- impl->toplevel->have_focused = TRUE;
+ impl->toplevel->have_focused = FALSE;
}
return impl->toplevel;